
select * from romess;
select * from adross;
select * from menu;
select * from role;
select * from admin;
--创建后台用户表
create table admin(
       ad_id number(3) primary key,
       ad_img varchar2(100),
       ad_account varchar2(40),
       ad_password varchar2(40),
       ad_name varchar2(10),
       ad_sex number(1),
       ad_phone varchar2(11),
       ad_email varchar2(50),
       ad_desc varchar2(200),
       ad_time DATE,
       ad_state number(1)
);

--创建后台用户ID序列
create sequence sequence_admin
minvalue 101
start with 101
increment by 1
drop sequence sequence_admin


--添加后台用户数据
insert into admin values(sequence_admin.nextval,'1.img','001','123456','测试一',1,'13867676767','1.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);
insert into admin values(sequence_admin.nextval,'2.img','002','123456','测试二',1,'13867676768','2.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),1);
insert into admin values(sequence_admin.nextval,'3.img','003','123456','测试三',0,'13867676769','3.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);
insert into admin values(sequence_admin.nextval,'4.img','004','123456','测试四',1,'13867676770','4.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),1);
insert into admin values(sequence_admin.nextval,'5.img','005','123456','测试五',0,'13867676771','5.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);
insert into admin values(sequence_admin.nextval,'6.img','006','123456','测试六',1,'13867676772','6.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),1);
insert into admin values(sequence_admin.nextval,'7.img','007','123456','测试七',0,'13867676773','7.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);
insert into admin values(sequence_admin.nextval,'8.img','008','123456','测试八',1,'13867676774','8.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);
insert into admin values(sequence_admin.nextval,'9.img','009','123456','测试九',1,'13867676775','9.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),1);
insert into admin values(sequence_admin.nextval,'10.img','010','123456','测试十',0,'13867676776','10.@qq.com','用于测试',to_date('2019-03-15 14:58:01','YYYY-MM-DD hh24:mi:ss'),0);


--创建角色表
create table role(
       ro_id number(3) primary key,
       ro_name varchar2(20),
       ro_desc varchar2(200),
       ro_rool varchar2(100)
);

--创建角色表的ID序列
create sequence sequence_role
minvalue 1
start with 1
increment by 1
drop sequence sequence_role
--添加角色数据
insert into role values(sequence_role.nextval,'超级管理员','权力最大，为所欲为','管理所有模块');
insert into role values(sequence_role.nextval,'一号管理员','普通管理员','管理父级二菜单');
insert into role values(sequence_role.nextval,'二号管理员','普通管理员','管理父级三菜单');
insert into role values(sequence_role.nextval,'三号管理员','普通管理员','管理父级四菜单');
insert into role values(sequence_role.nextval,'四号管理员','普通管理员','管理父级五菜单');
insert into role values(sequence_role.nextval,'五号管理员','普通管理员','管理父级六菜单');
delete role;

--创建菜单表
create table menu(
       me_id number(3) primary key,
       me_name varchar2(20),
       me_url varchar2(100),
       me_rool number(1),
       me_high number(3)
);
drop table menu;
--创建菜单表ID序列
create sequence sequence_menu
minvalue 101
start with 101
increment by 1
drop sequence sequence_menu
--添加菜单数据
insert into menu values(sequence_menu.nextval,'权限管理','1.jsp',1,100);
insert into menu values(sequence_menu.nextval,'商品管理','2.jsp',1,100);
insert into menu values(sequence_menu.nextval,'会员管理','3.jsp',1,100);
insert into menu values(sequence_menu.nextval,'福利活动','4.jsp',1,100);
insert into menu values(sequence_menu.nextval,'客服中心','5.jsp',1,100);
insert into menu values(sequence_menu.nextval,'网站管理','6.jsp',1,100);

insert into menu values(sequence_menu.nextval,'后台用户信息管理','7.jsp',1,101);
insert into menu values(sequence_menu.nextval,'菜单管理','8.jsp',1,101);
insert into menu values(sequence_menu.nextval,'角色管理','9.jsp',1,101);

insert into menu values(sequence_menu.nextval,'商品信息管理','10.jsp',1,102);
insert into menu values(sequence_menu.nextval,'商品分类管理','11.jsp',1,102);
insert into menu values(sequence_menu.nextval,'商品评价管理','12.jsp',1,102);

insert into menu values(sequence_menu.nextval,'会员信息管理','13.jsp',1,103);
insert into menu values(sequence_menu.nextval,'购物车管理','14.jsp',1,103);
insert into menu values(sequence_menu.nextval,'订单管理','15.jsp',1,103);
insert into menu values(sequence_menu.nextval,'积分管理','16.jsp',1,103);
insert into menu values(sequence_menu.nextval,'收藏管理','17.jsp',1,103);
insert into menu values(sequence_menu.nextval,'浏览记录管理','18.jsp',1,103);

insert into menu values(sequence_menu.nextval,'秒杀活动管理','19.jsp',1,104);
insert into menu values(sequence_menu.nextval,'优惠劵管理','20.jsp',1,104);

insert into menu values(sequence_menu.nextval,'在线回复','21.jsp',1,105);
insert into menu values(sequence_menu.nextval,'消息管理','22.jsp',1,105);

insert into menu values(sequence_menu.nextval,'广告管理','23.jsp',1,106);
insert into menu values(sequence_menu.nextval,'网页管理','24.jsp',1,106);


--创建后台用户角色关联表
create table ADROSS(
       adro_id number(3) primary key,
       admin_id number(3),
       role_id number(3)
);

--创建后台用户角色关联表ID序列
create sequence sequence_adross
minvalue 101
start with 101
increment by 1

--添加后台用户角色关联表数据
insert into adross values(sequence_adross.nextval,101,1);
insert into adross values(sequence_adross.nextval,102,2);
insert into adross values(sequence_adross.nextval,103,3);
insert into adross values(sequence_adross.nextval,104,4);
insert into adross values(sequence_adross.nextval,105,5);
insert into adross values(sequence_adross.nextval,106,6);
insert into adross values(sequence_adross.nextval,107,1);
insert into adross values(sequence_adross.nextval,108,2);
insert into adross values(sequence_adross.nextval,109,3);
insert into adross values(sequence_adross.nextval,110,4);


--创建角色菜单关联表
create table ROMESS(
       rome_id number(3) primary key,
       role_id number(3),
       menu_id number(3)
);

--创建角色菜单关联表ID序列
create sequence sequence_romess
minvalue 101
start with 101
increment by 1

--添加角色菜单关联表数据
insert into romess values(sequence_romess.nextval,1,101);
insert into romess values(sequence_romess.nextval,1,102);
insert into romess values(sequence_romess.nextval,1,103);
insert into romess values(sequence_romess.nextval,1,104);
insert into romess values(sequence_romess.nextval,1,105);
insert into romess values(sequence_romess.nextval,1,106);
insert into romess values(sequence_romess.nextval,1,107);
insert into romess values(sequence_romess.nextval,1,108);
insert into romess values(sequence_romess.nextval,1,109);
insert into romess values(sequence_romess.nextval,1,110);
insert into romess values(sequence_romess.nextval,1,111);
insert into romess values(sequence_romess.nextval,1,112);
insert into romess values(sequence_romess.nextval,1,113);
insert into romess values(sequence_romess.nextval,1,114);
insert into romess values(sequence_romess.nextval,1,115);
insert into romess values(sequence_romess.nextval,1,116);
insert into romess values(sequence_romess.nextval,1,117);
insert into romess values(sequence_romess.nextval,1,118);
insert into romess values(sequence_romess.nextval,1,119);
insert into romess values(sequence_romess.nextval,1,120);
insert into romess values(sequence_romess.nextval,1,121);
insert into romess values(sequence_romess.nextval,1,122);
insert into romess values(sequence_romess.nextval,1,123);
insert into romess values(sequence_romess.nextval,1,124);

insert into romess values(sequence_romess.nextval,2,102);
insert into romess values(sequence_romess.nextval,2,110);
insert into romess values(sequence_romess.nextval,2,111);
insert into romess values(sequence_romess.nextval,2,112);

insert into romess values(sequence_romess.nextval,3,103);
insert into romess values(sequence_romess.nextval,3,113);
insert into romess values(sequence_romess.nextval,3,114);
insert into romess values(sequence_romess.nextval,3,115);
insert into romess values(sequence_romess.nextval,3,116);
insert into romess values(sequence_romess.nextval,3,117);
insert into romess values(sequence_romess.nextval,3,118);

insert into romess values(sequence_romess.nextval,4,104);
insert into romess values(sequence_romess.nextval,4,119);
insert into romess values(sequence_romess.nextval,4,120);

insert into romess values(sequence_romess.nextval,5,105);
insert into romess values(sequence_romess.nextval,5,121);
insert into romess values(sequence_romess.nextval,5,122);

insert into romess values(sequence_romess.nextval,6,106);
insert into romess values(sequence_romess.nextval,6,123);
insert into romess values(sequence_romess.nextval,6,124);



































